// this file was added from scratch to the project by Josh Latvatalo
#include <iostream>
#include <sstream>
#include <string>
using namespace std;
#include "Time.h"


bool Time::time_valid(int h, int m)
{
	if(h<0||h>23)
		return false;
	if(m<0||m>59)
		return false;
	return true;
}
Time::Time(int h, int m)
{
	if(time_valid(h,m))
	{
		hour = h;
		minute = m;
	}
	else
		cerr<< "ERROR: Invalid time entry \n";
}

Time::Time(){}
string Time::display_time()
{
	ostringstream oss;
	oss<< "Hour: " << hour << " Minute: " << minute<< "\n";
	return oss.str();
}
